package com.jushu.storbox.database;

import com.jushu.storbox.entities.User;

public interface IUserDao extends IBaseDao {

	//table name
	public static final String TABLE_NAME = "user_table";

	//fileds name
	public static final String LOGIN_NAME = "long_name";
	public static final String ENCRY_PASSWORD = "encry_password";
	public static final String USER_ID = "user_id";
	public static final String STORE_PATH = "store_path";
	public static final String ALBUM_FOLDER_ID = "album_folder_id";
	public static final String ALBUM_ENABLED_FLAG = "album_enable_flag";
	public static final String ALBUM_AUTO_BACKUP = "album_auto_backup";
	public static final String ALBUM_BACKUP_ONLYWIFI = "album_back_onlywifi";
	public static final String ALBUM_BACK_STOP_FLAG = "album_back_stop";
	
	//table command
	public static final String TABLE_COMMAND = "Create table " + IUserDao.TABLE_NAME +" ("
		+ IUserDao.LOGIN_NAME +" text,"
		+ IUserDao.ENCRY_PASSWORD +" text,"
		+ IUserDao.USER_ID +" text,"
		+ IUserDao.STORE_PATH +" text,"
		+ IUserDao.ALBUM_FOLDER_ID +" text,"
		+ IUserDao.ALBUM_AUTO_BACKUP +" integer,"
		+ IUserDao.ALBUM_BACKUP_ONLYWIFI +" integer,"
		+ IUserDao.ALBUM_ENABLED_FLAG +" integer,"
		+ IUserDao.ALBUM_BACK_STOP_FLAG +" integer,"
		+ "CONSTRAINT pk_tb_user_list PRIMARY KEY ("
		+ IUserDao.USER_ID
		+ ")"
		+ ")";
	
	//constant
	public final static int ALBUM_ENABLED_FALSE = 0;
	public final static int ALBUM_ENABLED_TRUE = 1;
	
	public final static int ALBUM_AUTO_BACKUP_TRUE = 1;
	public final static int ALBUM_AUTO_BACKUP_FALSE = 0;

	public final static int ALBUM_BACKUP_ONLYWIFI_FALSE = 0;
	public final static int ALBUM_BACKUP_ONLYWIFI_TRUE = 1;
	
	public final static int ALBUM_BACKUP_STOPED_FALSE = 1;
	public final static int ALBUM_BACKUP_STOPED_TRUE = 0;
	
	//mothed
	public long insertUser(User user);
	public User getUser(String loginName, String encryPassword);
	public User getUser(String ownerId);
	public int updateUser(User user);
	public int updatePassword(User user);
	public int updateAlbumFolderId(User user);
	public int updateAlbumBackFlag(User user);
	public int updateWifiConfig(User user);
	public int updateAlbumEnableFlag(User user);
	public int updateBackStopFlag(User user);
	public void deleteUser(User user);
	
}
